<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Template • TodoMVC</title>
		<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
		<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
		<link rel="stylesheet" href="css/app.css">
		<script src="./js/vue.js"></script>
		<script src="./js/axios.js"></script>
	</head>
	<body>
		<section id="todoapp" class="todoapp">
			<header class="header">
				<h1>Todolist</h1>
				<!-- 使用双向数据绑定 修改数据 不在需要表单 trim去除空格 -->
				<input class="new-todo" v-model.trim="inp_data" @keyup.enter="addTodo" placeholder="What needs to be done?" autofocus>
			</header>
			<!-- tempalte vue提供的模板标签 专门用隐藏显示，有内容则表情不在 没有内容则起腹肌作用域左右 -->
		<template v-if="todo_data.length">
				<section class="main" >
					<input id="toggle-all" @click="toggleAll($event)" class="toggle-all" type="checkbox">
					<label for="toggle-all">Mark all as complete</label>
					<ul class="todo-list">
						<li :class="{completed:v.stat}" v-for="(v,k) in todo_data">
							<div class="view">
								<!-- 选中与不选中状态直接使用v-model 双向数据绑定来操作
								会自定帮我们修改数据绑定，页面页受到影响，双向绑定
							不再需要js参加操作 使用但双向绑顶完成 -->
								<input class="toggle" type="checkbox" @click="todoDone(v)" v-model:checked="v.stat">
								<label>{{v.title}}</label>
								<button class="destroy" @click="removeTodo(k)" class="destroy"></button>
							</div>
							<input class="edit" value="Create a TodoMVC template">
						</li>
					</ul>
				</section>
				<!-- This footer should hidden by default and shown when there are todos -->
				<footer class="footer">
					<!-- This should be `0 items left` by default -->
					<span class="todo-count"><strong>{{getNu}}</strong> item left</span>
					<!-- Remove this if you don't implement routing -->
					<ul class="filters">
						<li>
							<a class="selected" href="#/">All</a>
						</li>
						<li>
							<a href="#/active">Active</a>
						</li>
						<li>
							<a href="#/completed">Completed</a>
						</li>
					</ul>
					<!-- Hidden if no completed items are left ↓ -->
					<button class="clear-completed" @click="removeCompleted">Clear completed</button>
				</footer>
		</template>
		</section>
		
		<script src="node_modules/todomvc-common/base.js"></script>
		
		<script src="js/app.js"></script>
	</body>
</html>
